package chapter05;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TransactionTest {
/**
 * @Test
 * public void test1() {
	ApplicationContext applicationContext = new ClassPathXmlApplicationContext("chapter05/applicationContext.xml");
	AccountDao accountDao =(AccountDao) applicationContext.getBean("accountDao");
	accountDao.transfer("A", "B", 100);
	System.out.println("转账成功！");
}
 */
@Test
public void annotationTest() {
	ApplicationContext applicationContext = new ClassPathXmlApplicationContext("chapter05/applicationContext-annotation.xml");
	AccountDao accountDao =(AccountDao) applicationContext.getBean("accountDao");
	accountDao.transfer("A", "B", 100);
	 System.out.println("转账成功！");
}
}
